<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>demo3</title>
    <h1>条件判断</h1>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- 引入vue.js -->
    <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
</head>

<body>
    <div id="box">
        <p v-if="seen">嗝，我不饿！！</p>
    </div>
    <script>
        var box = new Vue({
            el: '#box',
            data: {
                seen: false
            }
        })

        box.seen = true
    </script>

</body>

</html>